rate = [0.2,0.4,0.5,0.6,0.8,1]
ma = 8297
for k in rate:
    filename = "linkrate"+str(k)+".txt"
    fopen = open(filename)
    page = []
    for line in fopen:
        seq = [x for x in range(1, ma + 1)]
        link = dict.fromkeys(seq)
        date = line.split()
        for i in range(0, ma):
            link[i + 1] = float(date[i])
        link = sorted(link.items(), key=lambda d: d[1], reverse=True)
        for i in range(0, 5):
            page.append(link[i][0])
        print(k," : ",page)